﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace AfterlifeLib.Weapons
{
    public class Weapon
    {
        Entity owner;
        /// <summary>
        /// The entity to which the Weapon belongs.
        /// </summary>
        [ContentSerializerIgnore]
        public Entity Owner
        {
            get { return owner; }
            set 
            {
                if(value != null)
                    owner = value; 
            }
        }

        string name;
        /// <summary>
        /// The name of the weapon, displayed in the HUD.
        /// </summary>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        string description;
        /// <summary>
        /// The description of the weapon.
        /// </summary>
        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        int damage;
        /// <summary>
        /// How much damage this weapon inflicts.
        /// </summary>
        public int Damage
        {
            get { return damage; }
            set { damage = value; }
        }

        float timeUntilNextStrike;
        /// <summary>
        /// The time we have to wait until we can use this weapon again
        /// (in seconds).
        /// </summary>
        [ContentSerializerIgnore]
        public float TimeUntilNextStrike
        {
            get { return timeUntilNextStrike; }
            protected set { timeUntilNextStrike = value; }
        }

        /// <summary>
        /// Parameterless constructor required for Content.Load().
        /// </summary>
        public Weapon() { }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name">The name of the weapon.</param>
        /// <param name="description">The description of the weapon.</param>
        public Weapon(string name, string description)
        {
            Name = name;
            Description = description;
        }

        public virtual void Update(GameTime gameTime)
        {

        }

        public virtual void Draw(SpriteBatch spriteBatch)
        {

        }
    }
}
